﻿package mortal.game.view.combinedServer.combinedSerDayRe1000
{
    import Message.Public.*;
    import com.gengine.utils.*;
    import com.mui.controls.*;
    import com.mui.display.*;
    import extend.language.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;
    import mortal.game.view.combinedServer.data.*;
    import mortal.game.view.common.*;

    public class CombinedSerDayRe1000Cell2 extends GCellRenderer
    {
        protected var _rank:GTextFiled;
        protected var _playName:GTextFiled;
        protected var _reNum:GTextFiled;
        protected var _line:ScaleBitmap;
        private var _info:SToplist;

        public function CombinedSerDayRe1000Cell2()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._rank = UIFactory.gTextField("1", 12, -3, 20, 20, this, GlobalStyle.textFormatPutong.setColor(16777215).center());
            this._playName = UIFactory.gTextField("玩家名字七个字", 40, -2, 100, 20, this, GlobalStyle.textFormatPutong.setColor(16777215).center());
            this._reNum = UIFactory.gTextField("123456", 134, -2, 100, 20, this, GlobalStyle.textFormatPutong.setColor(16777215).center());
            this._line = UIFactory.bg(9, 21, 206, 2, this, ImagesConst.SplitLine3);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._rank = null;
            this._playName = null;
            this._reNum = null;
            this._line = null;
            super.disposeImpl(param1);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            this._info = param1 as SToplist;
            if (this._info == null)
            {
                return;
            }
            if (this._info.rank == -1)
            {
                this._rank.htmlText = "" + this.setNameColor(1);
                this._playName.text = Language.getString(71383);
                this._reNum.text = Language.getString(71384);
                return;
            }
            this._rank.htmlText = "" + this.setNameColor(this._info.rank);
            this._playName.text = "" + this._info.entityName;
            if (CombinedSerUtil.canSeeRechargeMoney(this._info.rank, this._info.entityId))
            {
                this._reNum.text = "" + this._info.valueOne;
            }
            else
            {
                this._reNum.text = "???";
            }
            return;
        }// end function

        private function setNameColor(param1:int) : String
        {
            var _loc_2:String = "#ffffff";
            switch(param1)
            {
                case 1:
                {
                    _loc_2 = "#ffc293";
                    break;
                }
                case 2:
                {
                    _loc_2 = "#d618dd";
                    break;
                }
                case 3:
                {
                    _loc_2 = "#1bbee1";
                    break;
                }
                default:
                {
                    break;
                }
            }
            return HTMLUtil.addColor("" + param1, _loc_2);
        }// end function

    }
}
